Skip to content

Do not allocate MemorySegments for memory.data(i32, i32?)#2831

Open
CountBleck wants to merge 1 commit intoAssemblyScript:mainfrom
CountBleck:fix-large-memory-crash
Open

Do not allocate MemorySegments for memory.data(i32, i32?)#2831
CountBleck wants to merge 1 commit intoAssemblyScript:mainfrom
CountBleck:fix-large-memory-crash

Conversation

@CountBleck
Copy link
Copy Markdown
Member

Fixes #2827.

Changes proposed in this pull request:
⯈ Bump Compiler#memoryOffset instead of allocating zero-filled segments.

There is an issue with the initialPages calculation in initDefaultMemory, however. The existing condition to run that calculation depends on memorySegments.length, which is now zero if only memory.data(n: i32) is called, as in the memory-config-errors test.
Making that calculation occur regardless of the number of memory segments would cause a separate issue: due to the default memory offsets of options.memoryBase, 1024, or 8, modules that previously compiled with an initial memory of 0 pages would compile with a minimum of 1 page.

  • I've read the contributing guidelines
  • I've added my name and email to the NOTICE file

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

as crash when try to alloc large data

3 participants